package com.wc5818.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import com.wc5818.entity.WC_COM_Order;
import com.wc5818.mapper.WC_COM_OrderMapper;

@Service
public class WC_COM_OrderService implements WC_COM_OrderMapper{
	
	@Autowired
	WC_COM_OrderMapper ordermapper;
	

	
	//public getWCComOrderForUserNameOrForbyusername(username,forbyusername)
	
	/***
	 *   根据用户名 和所属业务员返回数据
	 * @param username
	 * @param forbyusername
	 * @return
	 */
	public List<WC_COM_Order> getWCComOrderForUserNameOrForbyusername(String username,String forbyusername) {
		return ordermapper.getWCComOrderForUserNameOrForbyusername(username,forbyusername);
	}
	
	/**
	 * 获取订单表数据
	 * @return
	 */
	public List<WC_COM_Order> getAllWCComOrder(){
		
		return ordermapper.getAllWCComOrder();
		
	}
	
	/***
	 *      修改订单状态 根据订单号
	 * @param num
	 * @param status
	 * @return
	 */
	public int upWCCOMOrderStatusForNum(String ordernum,String status) {
		
		return ordermapper.upWCCOMOrderStatusForNum(ordernum, status);
		
	}
	 
	 
	 /**
	  * 根据订单号获取相关数据
	  * @param ordernum
	  * @return
	  */
	public List<WC_COM_Order> getWCComOrderForNum(String ordernum){
		
		
		return ordermapper.getWCComOrderForNum(ordernum);
		
	}
	 
	 /**
	  * 根据用户名获取相关数据
	  * @param ordernum
	  * @return
	  */
	public List<WC_COM_Order> getWCComOrderForUserName(String username){
		
		
		return ordermapper.getWCComOrderForUserName(username);
		
	}
	 
	 /**
	  * 添加订单表
	  * @param order
	  * @return
	  */
	 public int addWCComOrder(WC_COM_Order order) {
		 
		 return ordermapper.addWCComOrder(order);
		 
		 
	 }
	
	 
	

}
